﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Admin_DangNhap : System.Web.UI.Page
{
    DangNhap dn = new DangNhap();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack == false)
        {
            if (Session["user"] != null)
                Response.Redirect("Phim.aspx");
            else
                Label1.Text = "Bạn chưa đang nhập";
        }

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string kq = dn.Dang_Nhap_admim(TextBox1.Text, TextBox2.Text);
        if (kq == "")
            Label1.Text = "Đăng nhập thất bại";
        else
            Session["user"] = kq;
            Response.Redirect("Phim.aspx");
    }
}
